package utils

func MapIsEmpty(m map[string]any) bool {
	return len(m) == 0
}

func MapKeyExists(m map[string]any, key string) bool {
	_, ok := m[key]
	return ok
}

func MapKeyExistsAndValueIsString(m map[string]any, key string) bool {
	v, ok := m[key]
	return ok && v.(string) != ""
}

func MapValue(m map[string]any, key string) any {
	return m[key]
}
func MapValueString(m map[string]any, key string) string {
	str, ok := m[key].(string)
	if !ok {
		return ""
	}
	return str
}

func MapValueUint64(m map[string]any, key string) uint64 {
	val, ok := m[key].(uint64)
	if !ok {
		return 0
	}
	return val
}
